﻿/*******************************************************************************
 * Copyright © 2017 FriendStar.Framework 版权所有
 * Author: FZH
 * Description: FriendStar快速开发平台
 * Website：http://www.FriendStar.cn
*********************************************************************************/
using System;
using SqlSugar;

namespace FriendStar.Domain.Entity.BOM
{
    /// <summary>
	/// 数据视图 V_CLDE_12_GG_CLDEerialQuota_DA 对应的数据实体类，数据表描述：
	/// </summary>
    [Serializable]
    [SugarMapping(TableName = "V_CLDE_12_GG_CLDEerialQuota_DA")]
	public partial class V_CLDE_12_GG_CLDEerialQuota_DAEntity
    {
        ///<summary>
		///
		///</summary>
        public string ChangeType { get; set; } 
        ///<summary>
		///
		///</summary>
        public string UseUnit { get; set; } 
        ///<summary>
		///
		///</summary>
        public string FProductionNO { get; set; } 
        ///<summary>
		///
		///</summary>
        public string FProductionName { get; set; } 
        ///<summary>
		///
		///</summary>
        public string ProductUnit { get; set; } 
        ///<summary>
		///
		///</summary>
        public string ProductUnitName { get; set; } 
        ///<summary>
		///
		///</summary>
        public string ProduWorkshop { get; set; } 
        ///<summary>
		///
		///</summary>
        public string ProduWorkshopName { get; set; } 
        ///<summary>
		///
		///</summary>
        public string MaterialType { get; set; } 
        ///<summary>
		///
		///</summary>
        public string MaterialTypeName { get; set; } 
        ///<summary>
		///
		///</summary>
        public string MaterialNO { get; set; } 
        ///<summary>
		///
		///</summary>
        public string MaterialName { get; set; } 
        ///<summary>
		///
		///</summary>
        public string MaterialCode { get; set; } 
        ///<summary>
		///
		///</summary>
        public string MaterialSizes { get; set; } 
        ///<summary>
		///
		///</summary>
        public string StandardNumber { get; set; } 
        ///<summary>
		///
		///</summary>
        public string MaterialDemand { get; set; } 
        ///<summary>
		///
		///</summary>
        public decimal? ProduNumber { get; set; } 
        ///<summary>
		///
		///</summary>
        public string RoughsType { get; set; } 
        ///<summary>
		///
		///</summary>
        public string Fiberdirection { get; set; } 
        ///<summary>
		///
		///</summary>
        public string RoughsSize { get; set; } 
        ///<summary>
		///
		///</summary>
        public string WposiTolerance { get; set; } 
        ///<summary>
		///
		///</summary>
        public string WnegaTolerance { get; set; } 
        ///<summary>
		///
		///</summary>
        public string HposiTolerance { get; set; } 
        ///<summary>
		///
		///</summary>
        public string HnegaTolerance { get; set; } 
        ///<summary>
		///
		///</summary>
        public string Roughsstandard { get; set; } 
        ///<summary>
		///
		///</summary>
        public decimal? MaterialQuota { get; set; } 
        ///<summary>
		///
		///</summary>
        public decimal? LsNetWeight { get; set; } 
        ///<summary>
		///
		///</summary>
        public decimal? CNetWeight { get; set; } 
        ///<summary>
		///
		///</summary>
        public decimal? LRoughsWeight { get; set; } 
        ///<summary>
		///
		///</summary>
        public decimal? CRoughsWeight { get; set; } 
        ///<summary>
		///
		///</summary>
        public decimal? Lconsume { get; set; } 
        ///<summary>
		///
		///</summary>
        public decimal? Pconsume { get; set; } 
        ///<summary>
		///
		///</summary>
        public decimal? LUtilization { get; set; } 
        ///<summary>
		///
		///</summary>
        public decimal? PUtilization { get; set; } 
        ///<summary>
		///
		///</summary>
        public string WasteFProductionNO { get; set; } 
        ///<summary>
		///
		///</summary>
        public string WasteFProductionName { get; set; } 
        ///<summary>
		///
		///</summary>
        public string WasteUnit { get; set; } 
        ///<summary>
		///
		///</summary>
        public string WasteUnitName { get; set; } 
        ///<summary>
		///
		///</summary>
        public string WasteWorkshop { get; set; } 
        ///<summary>
		///
		///</summary>
        public string WasteWorkshopName { get; set; } 
        ///<summary>
		///
		///</summary>
        public decimal? WasteProportion { get; set; } 
        ///<summary>
		///
		///</summary>
        public string SubstitMaterial { get; set; } 
        ///<summary>
		///
		///</summary>
        public string Note { get; set; } 
        ///<summary>
		///
		///</summary>
        public string MaintainStatus { get; set; } 
        ///<summary>
		///
		///</summary>
        public string MateAlterTecNO { get; set; } 
        ///<summary>
		///
		///</summary>
        public string MateAlterTecDate { get; set; } 
        ///<summary>
		///
		///</summary>
        public string FCreateBy { get; set; } 
        ///<summary>
		///
		///</summary>
        public string FCreateDate { get; set; } 
        ///<summary>
		///
		///</summary>
        public string FCreateTime { get; set; } 
        ///<summary>
		///
		///</summary>
        public string FUpdateBy { get; set; } 
        ///<summary>
		///
		///</summary>
        public string FUpdateDate { get; set; } 
        ///<summary>
		///
		///</summary>
        public string FUpdateTime { get; set; }




        public string RoughsSize1
        {
            get
            {
                if (RoughsType == "K" || RoughsType == "T")
                {
                    if (string.IsNullOrEmpty(RoughsSize)) { return ""; }
                    if (RoughsSize.Length < 6) { return ""; }
                    return RoughsSize.Substring(0, 6).Trim();
                }
                else
                {
                    return "";
                }
            }
        }
        public string RoughsSize2
        {
            get
            {
                if (RoughsType == "K" || RoughsType == "T")
                {
                    if (string.IsNullOrEmpty(RoughsSize)) { return ""; }
                    if (RoughsSize.Length < 13) { return ""; }
                    return RoughsSize.Substring(7, 6).Trim();
                }
                else
                {
                    return "";
                }
            }
        }
        public string RoughsSize3
        {
            get
            {
                if (RoughsType == "K" || RoughsType == "T")
                {
                    if (string.IsNullOrEmpty(RoughsSize)) { return ""; }
                    if (RoughsSize.Length < 16) { return "1"; }
                    return RoughsSize.Substring(14, 2).Trim();
                }
                else
                {
                    return "1";
                }
            }
        }
        public string RoughsSize4
        {
            get
            {
                if (RoughsType == "K" || RoughsType == "T")
                {
                    if (string.IsNullOrEmpty(RoughsSize)) { return ""; }
                    if (RoughsSize.Length < 22) { return "0.0"; }
                    return RoughsSize.Substring(17, 5).Trim();
                }
                else
                {
                    return "";
                }
            }
        }
        public string RoughsSize5
        {
            get
            {
                if (RoughsType == "Y" || RoughsType == "L")
                {
                    return RoughsSize;
                }
                else
                {
                    return "";
                }
            }
        }
        public string MaterialSizes1
        {
            get
            {
                if (string.IsNullOrEmpty(MaterialSizes)) { return ""; }
                if (MaterialSizes.Length < 5) { return ""; }
                return MaterialSizes.Substring(0, 5).Trim();
            }
        }
        public string MaterialSizes2
        {
            get
            {
                if (string.IsNullOrEmpty(MaterialSizes)) { return ""; }
                if (MaterialSizes.Length < 10) { return ""; }
                return MaterialSizes.Substring(6, 4).Trim();
            }
        }
        public string MaterialSizes3
        {
            get
            {
                if (string.IsNullOrEmpty(MaterialSizes)) { return ""; }
                if (MaterialSizes.Length < 16) { return "C"; }
                return MaterialSizes.Substring(11, 5).Trim();

            }
        }
        public string Roughsstandard1
        {
            get
            {
                if (string.IsNullOrEmpty(Roughsstandard)) { return ""; }
                if (Roughsstandard.Length < 6) { return ""; }
                return Roughsstandard.Substring(0, 6).Trim();

            }
        }
        public string Roughsstandard2
        {
            get
            {
                if (string.IsNullOrEmpty(Roughsstandard)) { return ""; }
                if (Roughsstandard.Length < 13) { return ""; }
                return Roughsstandard.Substring(7, 6).Trim();
            }
        }

        public string MaterialTypeAll
        {
            get
            {

                return (!string.IsNullOrEmpty(MaterialType) && !string.IsNullOrEmpty(MaterialTypeName)) ? MaterialType + " " + MaterialTypeName : "";
            }
        }
        public string MaterialAll
        {
            get
            {

                return (!string.IsNullOrEmpty(MaterialNO) && !string.IsNullOrEmpty(MaterialName)) ? MaterialNO + " " + MaterialName : "";
            }
        }
        public string ProduWorkshopAll
        {
            get
            {

                return (!string.IsNullOrEmpty(ProduWorkshop) && !string.IsNullOrEmpty(ProduWorkshopName)) ? ProduWorkshop + " " + ProduWorkshopName : "";
            }
        }

        public string ProductUnitAll
        {
            get
            {

                return (!string.IsNullOrEmpty(ProductUnit) && !string.IsNullOrEmpty(ProductUnitName)) ? ProductUnit + " " + ProductUnitName : "";
            }
        }

        public string WasteUnitAll
        {
            get
            {

                return (!string.IsNullOrEmpty(WasteUnit) && !string.IsNullOrEmpty(WasteUnitName)) ? WasteUnit + " " + WasteUnitName : "";
            }
        }

        public string WasteWorkshopAll
        {
            get
            {

                return (!string.IsNullOrEmpty(WasteWorkshop) && !string.IsNullOrEmpty(WasteWorkshopName)) ? WasteWorkshop + " " + WasteWorkshopName : "";
            }
        }


        public string MaterialQuotaShow
        {
            get
            {
                if (MaterialQuota.HasValue)
                {
                    return MaterialQuota.Value.ToString("0.000000");
                }
                else
                {
                    return "";
                }
            }
        }
        public string LsNetWeightShow
        {
            get
            {
                if (LsNetWeight.HasValue)
                {
                    return LsNetWeight.Value.ToString("0.000000");
                }
                else
                {
                    return "";
                }
            }
        }
        public string CNetWeightShow
        {
            get
            {
                if (CNetWeight.HasValue)
                {
                    return CNetWeight.Value.ToString("0.000000");
                }
                else
                {
                    return "";
                }
            }
        }
        public string LRoughsWeightShow
        {
            get
            {
                if (LRoughsWeight.HasValue)
                {
                    return LRoughsWeight.Value.ToString("0.000000");
                }
                else
                {
                    return "";
                }
            }
        }
        public string CRoughsWeightShow
        {
            get
            {
                if (CRoughsWeight.HasValue)
                {
                    return CRoughsWeight.Value.ToString("0.000000");
                }
                else
                {
                    return "";
                }
            }
        }
        public string LconsumeShow
        {
            get
            {
                if (Lconsume.HasValue)
                {
                    return Lconsume.Value.ToString("0.000000");
                }
                else
                {
                    return "";
                }
            }
        }
        public string PconsumeShow
        {
            get
            {
                if (Pconsume.HasValue)
                {
                    return Pconsume.Value.ToString("0.000000");
                }
                else
                {
                    return "";
                }
            }
        }

        public string LUtilizationShow
        {
            get
            {
                if (LUtilization.HasValue)
                {
                    return LUtilization.Value.ToString("0.00");
                }
                else
                {
                    return "";
                }
            }
        }

        public string PUtilizationShow
        {
            get
            {
                if (PUtilization.HasValue)
                {
                    return PUtilization.Value.ToString("0.00");
                }
                else
                {
                    return "";
                }
            }
        }
    }
}